package com.ftj.mapper;

import com.ftj.entity.AdminUser;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * Created by 21seu.ftj on 2020/9/13 16:34
 * @author 21seu.ftj
 */
@Mapper
public interface AdminUserMapper {

    /**
     * 登录
     * @param loginName
     * @param password
     * @return
     */
    AdminUser login(@Param("loginName") String loginName, @Param("password") String password);

    /**
     * 根据ID查找用户
     * @param loginUserId
     * @return
     */
    AdminUser getUserDetailById(Integer loginUserId);

    /**
     * 根据ID修改用户名，和昵称
     *
     * @param adminUserId
     * @param loginUserName
     * @param nickName
     * @return
     */
    boolean updateName(@Param("adminUserId") Integer adminUserId, @Param("loginUserName") String loginUserName, @Param("nickName") String nickName);

    /**
     * 根据ID修改密码
     * @param loginUserId
     * @param originalPassword
     * @param newPassword
     * @return
     */
    boolean updatePassword(@Param("adminUserId") Integer loginUserId, String originalPassword, @Param("newPassword") String newPassword);
}
